package com.learn.basic;

import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.LinkedHashSet;
import java.util.Set;

public class reflection {
    public static void main(String[] args) throws Exception{
        String[] strArr = {"128","127"};
        Set<String> set = new LinkedHashSet<>(Arrays.asList(strArr));
        set.add("127"); 
        Class<?> clazz = set.getClass();
        Method method = clazz.getDeclaredMethod("add");
        method.invoke(set, 127);
        method.invoke(set, 128);
        System.out.println(set);
    }   
}
